<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>IQC检测</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/3nod_web/layui/css/layui.css" media="all">
    <style>
        #myform {
            zoom: 0.75;
        }
        .inputDisabled {

            cursor: not-allowed;

            /*color: #a29e9e!important;*/

            background: #a29e9e!important;

        }
    </style>
</head>
<body>

<div id="content" th:if="${msg==null}">
    <!--<form class="layui-form" onsubmit="javascript:;">-->
    <form class="layui-form" action="javascript:;" id="myform">
        <input type="hidden" th:value="${library}" id="library">
        <input type="hidden" th:value="${session.users}" id="users">
        <!--IQC检验详情-->
        <form class="layui-form" action="">
            <input type="hidden" th:value="${iqcDetection.receiptLineNumber}" name="receiptLineNumber">
            <input type="hidden" th:value="${iqcDetection.loc}" name="loc">
            <input type="hidden" th:value="${iqcDetection.receiptKey}" name="receiptKey">
            <input type="hidden" th:value="${iqcDetection.supplierName}" name="supplierName">
            <input type="hidden" th:value="${iqcDetection.inspectionCategory}" name="inspectionCategory">
            <input type="hidden" th:value="${iqcDetection.qualityStatus}" name="qualityStatus">
            <input type="hidden" th:value="${iqcDetection.checkItemFlag}" name="checkItemFlag">
            <div class=" layui-inline">
                <div class=" layui-form-item">
                    <div class=" layui-inline">
                        <label class="layui-form-label">判定方式</label>
                        <i class="layui-icon">&#xe60c;</i>
                        <div class="layui-input-inline " style="width: 130px;">
                            <div style="display: block" id="decideWay1">
                                <select id="decideWay" lay-filter="decideWay" lay-search name="decideWay" >
                                    <option value="">请选择</option>
                                    <option th:each="decideWay:${iqcDetection.decideWayList}"
                                            th:value="${decideWay.code}"
                                            th:text="${decideWay.description}"
                                    ></option>
                                </select>
                            </div>
                            <div style="display: none" id="decideWay2">
                                <!--隐藏-->
                                <select id="decideWayb" lay-filter="decideWay" lay-search name="decideWay">
                                    <option value="0">接收</option>
                                </select>
                            </div>
                        </div>
                    </div>

                    <div class="  layui-inline">
                        <label class="layui-form-label">货主</label>
                        <i class="layui-icon">&#xe615;</i>
                        <div class="layui-input-inline" style="width: 130px;">
                            <input type="text" name="shipper" readonly placeholder=""
                                   autocomplete="off" class="layui-input inputDisabled" th:value="${iqcDetection.shipper}">
                        </div>
                    </div>

                    <div class="  layui-inline">
                        <label class="layui-form-label">检验方案</label>
                        <i class="layui-icon">&#xe615;</i>
                        <div class="layui-input-inline " style="width: 130px;">
                            <input type="hidden" th:value="${inspectionPlanMgt2.checkProjectKey}" id="checkProjectKey">
                            <input type="hidden" th:value="${inspectionPlanMgt2.sampleKey}" id="sampleKey">
                            <select id="scheme" lay-filter="interest" lay-search name="checkScenarioName">
                                <option th:each="inspectionPlanMgt:${inspectionPlanMgtList}"
                                        th:value="${inspectionPlanMgt.checkScenarioName}"
                                        th:selected="${inspectionPlanMgt.checkScenarioName==checkScenarioName}"
                                        th:text="${inspectionPlanMgt.describe}"
                                ></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class=" layui-form-item">
                    <div class=" layui-inline">
                        <label class="layui-form-label">机型</label>
                        <div class="layui-input-inline " style="width: 130px;">
                            <select id="type" lay-search name="modelKey">
                                <option value="">请选择</option>
                                <option th:each="model:${modelsMgtList}" th:value="${model.modelKey}"
                                        th:text="${model.modelName}"
                                        th:selected="${iqcDetection.modelKey==model.modelKey}"
                                    ></option>
                            </select>
                        </div>
                    </div>

                    <div class="  layui-inline">
                        <label class="layui-form-label">物料编码</label>
                        <div class=" layui-input-inline" style="width: 130px;">
                            <input type="text" name="sku" readonly placeholder=""
                                   autocomplete="off" class="layui-input inputDisabled" th:value="${iqcDetection.sku}">
                        </div>
                    </div>

                    <div class="  layui-inline">
                        <label class="layui-form-label">物料描述</label>
                        <div class=" layui-input-inline" style="width: 130px;">
                            <input type="text" name="materialDesc" placeholder="" readonly
                                   autocomplete="off" class="layui-input inputDisabled" th:value="${iqcDetection.materialDesc}">
                        </div>
                    </div>
                </div>
                <div class=" layui-form-item">
                    <div class=" layui-inline">
                        <label class="layui-form-label">送货单</label>
                        <div class="layui-input-inline " style="width: 130px;">
                            <input type="text" name="extReceiptForm" placeholder="" readonly style="width: 170px;"
                                   autocomplete="off" class="layui-input inputDisabled" th:value="${iqcDetection.extReceiptForm}">
                        </div>
                    </div>

                    <div class="  layui-inline">
                        <label class="layui-form-label" style="width: 90px;">供应商代码</label>
                        <div class=" layui-input-inline" style="width: 130px;">
                            <input type="text" name="supplierKey" placeholder="" readonly
                                   autocomplete="off" class="layui-input inputDisabled" th:value="${iqcDetection.supplierKey}">
                        </div>
                    </div>

                    <div class="  layui-inline">
                        <label class="layui-form-label">待检数量</label>
                        <div class=" layui-input-inline" style="width: 130px;">
                            <input type="text" name="quarantineQuantity" placeholder="" readonly
                                   autocomplete="off" class="layui-input inputDisabled" th:value="${iqcDetection.quarantineQuantity}">
                        </div>
                    </div>
                </div>
                <div class=" layui-form-item">
                    <div class=" layui-inline">
                        <label class="layui-form-label">抽检数量</label>
                        <div class="layui-input-inline " style="width: 130px;">
                            <input type="text" name="samplingQuantity" readonly placeholder=""
                                   onblur="updateConformityQuantity()"
                                   autocomplete="off" class="layui-input inputDisabled"
                                   th:value="${iqcDetection.samplingQuantity}">
                        </div>
                    </div>

                    <div class="  layui-inline">
                        <label class="layui-form-label">合格数量</label>
                        <div class=" layui-input-inline" style="width: 130px;">
                            <input type="text" name="conformityQuantity" placeholder="" readonly
                                   autocomplete="off" class="layui-input inputDisabled"
                                   th:value="${iqcDetection.conformityQuantity}"
                            >
                        </div>
                    </div>

                    <div class="  layui-inline">
                        <label class="layui-form-label" style="width: 90px;">不合格数量</label>
                        <div class=" layui-input-inline" style="width: 130px;">
                            <input type="text" name="unqualifiedQuantity" placeholder="" readonly
                                   onblur="updateConformityQuantity()"
                                   autocomplete="off" class="layui-input inputDisabled"
                                   th:value="${iqcDetection.unqualifiedQuantity}">
                        </div>
                    </div>
                </div>
                <div class=" layui-form-item">
                    <div class=" layui-inline">
                        <label class="layui-form-label">不良率</label>
                        <div class="layui-input-inline " style="width: 130px;">
                            <input type="text" name="rejectRation" placeholder=""
                                   autocomplete="off" class="layui-input inputDisabled"
                                   readonly
                                   th:value="${iqcDetection.rejectRation}"
                            >
                        </div>
                    </div>
                    <div class="  layui-inline">
                        <label class="layui-form-label">留样数量</label>
                        <div class=" layui-input-inline" style="width: 130px;">
                            <input type="text" name="sampleQuantity" placeholder="" readonly
                                   autocomplete="off" class="layui-input inputDisabled"
                                   th:value="${iqcDetection.sampleQuantity}">
                        </div>
                    </div>

                    <div class="  layui-inline">
                        <label class="layui-form-label">拒收数量</label>
                        <div class=" layui-input-inline" style="width: 130px;">
                            <input type="text" name="rejectionQuantity" placeholder="" readonly
                                   autocomplete="off" class="layui-input inputDisabled"
                                   th:value="${iqcDetection.rejectionQuantity}"
                            >
                        </div>
                    </div>
                </div>
                <div class=" layui-form-item">
                    <div class="  layui-inline">
                        <label class="layui-form-label">检验结果</label>
                        <div class=" layui-input-inline" style="width: 130px;">
                            <input type="text" name="checkResult" readonly placeholder=""
                                   autocomplete="off" class="layui-input inputDisabled"

                            >
                        </div>
                    </div>

                    <div class="  layui-inline">
                        <label class="layui-form-label">不良原因</label>
                        <div class=" layui-input-inline" style="width: 130px;">
                            <input type="text" name="culprit" placeholder=""
                                   autocomplete="off" class="layui-input" th:value="${iqcDetection.culprit}">
                        </div>
                    </div>
                    <div class="  layui-inline">
                        <label class="layui-form-label">备注</label>
                        <div class=" layui-input-inline" style="width: 130px;">
                            <input type="text" name="remark" placeholder=""
                                   autocomplete="off" class="layui-input" th:value="${iqcDetection.remark}">
                        </div>
                    </div>
                </div>
                <div class=" layui-form-item">
                    <div class="  layui-inline">
                        <label class="layui-form-label">实验类别</label>
                        <div class=" layui-input-inline" style="width: 130px;">
                            <input type="text" name="experimentType" placeholder=""
                                   autocomplete="off" class="layui-input" th:value="${iqcDetection.experimentType}">
                        </div>
                    </div>

                    <div class="  layui-inline">
                        <label class="layui-form-label">实验数量</label>
                        <div class=" layui-input-inline" style="width: 130px;">
                            <input type="text" name="experimentNumber" placeholder=""
                                   autocomplete="off" class="layui-input" th:value="${iqcDetection.experimentNumber}">
                        </div>
                    </div>

                    <div class="  layui-inline">
                        <label class="layui-form-label">入库数量</label>
                        <div class=" layui-input-inline" style="width: 130px;">
                            <input type="text" name="inventoryQuantity" placeholder=""
                                   autocomplete="off" class="layui-input inputDisabled" th:value="${iqcDetection.inventoryQuantity}">
                        </div>
                    </div>

                </div>

                <div class=" layui-form-item">

                    <div class="  layui-inline">
                        <label class="layui-form-label">验退数量</label>
                        <div class=" layui-input-inline" style="width: 130px;">
                            <input type="text" name="checkBackQuantity" placeholder=""
                                   autocomplete="off" class="layui-input inputDisabled" th:value="${iqcDetection.checkBackQuantity}">
                        </div>
                    </div>

                    <div class="layui-inline" id="specialMining" >
                        <label class="layui-form-label">特采单号</label>
                        <div class=" layui-input-inline" style="width: 130px;">
                            <input type="text" name="specialMiningOrder" placeholder=""
                                   autocomplete="off" class="layui-input" th:value="${iqcDetection.specialMiningOrder}">
                        </div>
                    </div>


                    <div class="  layui-inline" id="upload">
                        <button type="button" class="layui-btn" id="uploadFile"><i class="layui-icon"></i>上传文件</button>
                        <button type="button" class="layui-btn layui-hide" id="uploadFile1"></button>
                        <input type="text" id="fileName" name="fileName" placeholder="" autocomplete="off" class="layui-input  layui-hide">
                    </div>

                </div>

            </div>
            <!--表格-->
            <div class=" layui-inline">
                <table id="demo2" lay-filter="test2"></table>
            </div>
            <!--事件按钮-->
            <div class="">
                <button class="layui-btn layui-btn-radius layui-btn-primary" type="submit" lay-submit=""
                        lay-filter="save" name="save" id="save">保存
                </button>
                <button class="layui-btn layui-btn-radius layui-btn-primary" type="submit" lay-submit=""
                        lay-filter="submit" name="submit">提交
                </button>
                <button class="layui-btn layui-btn-radius layui-btn-primary" type="button"
                        onclick="toHome()">返回
                </button>
            </div>
        </form>
    </form>

    <div class="layui-tab" lay-filter="test" id="tabdiv">
        <ul class="layui-tab-title">
            <li class="layui-this" lay-id="11">检验项目</li>
            <li lay-id="22">检验明细</li>
        </ul>
        <div class="layui-tab-content" style="width: 98%">
            <!--检验项目-->
            <div class="layui-tab-item layui-show">
                <div>
                    <form class="layui-form" action="javascript:;">
                        <!--<button class="layui-btn layui-btn-radius layui-btn-primary" type="submit" lay-submit="" lay-filter="save2"  name="save">保存</button>-->
                        <table class="layui-hide" id="demo" lay-filter="checkItem"></table>
                    </form>
                </div>
            </div>
            <!--检验明细-->
            <div class="layui-tab-item">

                <table class="layui-hide" id="detectionDetailList" lay-filter="detectionDetailListLF"></table>

            </div>
        </div>
    </div>
</div>

<a href="javascript:history.go(-1)">
    <h1 style="color: red">
        <div th:text="${msg}"></div>
    </h1>
</a>
<script src="/3nod_web/js/jquery-1.8.3.js" charset="utf-8"></script>
<script src="/3nod_web/layui/layui.js" charset="utf-8"></script>
<script src="/3nod_web/js/iqc/checkItem.js" charset="utf-8"></script>
<script src="/3nod_web/js/iqc/detectionDetail.js" charset="utf-8"></script>
<script src="/3nod_web/js/iqc/aql.js" charset="utf-8"></script>
<script src="/3nod_web/js/iqc/table.js" charset="utf-8"></script>
<script src="/3nod_web/js/iqc/form.js" charset="utf-8"></script>
<script type="text/html" id="xuhao">
    {{d.LAY_TABLE_INDEX+1}}
</script>
<script>
    var iqcData = null;
    var sku = $("[name=sku]").val();
    var receiptKey = $("[name=receiptKey]").val();


    //注意：选项卡 依赖 element 模块，否则无法进行功能性操作
    layui.use('element', function () {
        var element = layui.element;
    });

    //返回主界面
    function toHome() {
        var library = $("#library").val();
        var users = $("#users").val();
        //通过ajax存储返回标识到服务器，页面自动回车的时候需要用到
        $.get("/3nod_web/iqcDetection/setReturnFlag?flag=1");
        location.href = '/3nod_web/iqc/iqcManager?library=' + library + "&users=" + users;
    }

</script>
</body>
</html>